package com.itheima.test;

import java.util.Random;

public class test6 {
    public static void main(String[] args) {
        //随机数范围1-100
        Random r = new Random();
        //生成随机数
        int number = r.nextInt(100) + 1;//1-100
        System.out.println(number);

        //秘诀：生成任意数到任意数的随机数
        //1.范围头尾都减一个值
        Random r1 = new Random();
        int number1 = r1.nextInt(9) + 7;//7-15
        System.out.println(number1);
    }
}
